<template>
  <div class="content-warpper">
    <div class="left-tree">
      <el-input
        placeholder="输入主题名称"
        v-model="filterText"
        class="form-input"
        suffix-icon="el-icon-search"
        size="small"
      >
      </el-input>
      <el-tree
        v-if="isShowTree"
        class="filter-tree"
        :data="subjectList"
        :props="defaultProps"
        @node-click="handleNodeClick"
        :default-expand-all="true"
        :filter-node-method="filterNode"
        node-key="id"
        :default-checked-keys="[selectedNodeID]"
        :highlight-current="true"
        ref="tree"
      ></el-tree>
    </div>
    <!-- v-if="
          modelList.length > 0 ||
          modelData.modelName !== '' ||
          modelData.modelStatus !== ''
        " -->
    <div class="server-main right-content">
      <el-form :inline="true" v-model="modelData" class="search-form">
        <el-form-item label="模型名称" class="form-input">
          <el-input
            placeholder="请输入模型名称"
            v-model.trim="modelData.modelName"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="状态" class="status form-input">
          <el-select v-model="modelData.modelStatus">
            <el-option label="全部" value=""></el-option>
            <el-option label="编辑中" :value="0"></el-option>
            <el-option label="已发布" :value="1"></el-option>
            <el-option label="已停用" :value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button id="btn" size="small" type="primary" @click="onSubmit(1)"
            >查询</el-button
          >
        </el-form-item>
      </el-form>
      <div class="server-table">
        <div class="table-title">
          <span class="table-title-text">逻辑模型</span>
          <div>
            <el-button
              :disabled="!addAble"
              type="primary"
              size="small"
              @click="openCreateOntology()"
              >创建模型</el-button
            >
            <el-button
              type="primary"
              size="small"
              @click="openCreatePhysicalModel"
              >生成物理模型</el-button
            >
          </div>
        </div>
        <el-table
          :data="modelList"
          class="km-table"
          @selection-change="handleSelectionChange"
          ref="multipleTable"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column
            type="index"
            label="ID"
            width="50"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="modelCode"
            label="模型编码"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="modelName"
            label="模型名称"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="description"
            label="模型说明"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="themeName"
            label="所属主题"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="version"
            label="版本"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="modelStatus"
            label="状态"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <i
                class="little-circle-yellow"
                v-if="scope.row.modelStatus === 0"
              ></i>
              <span v-if="scope.row.modelStatus === 0">编辑中</span>
              <i
                class="little-circle-green"
                v-if="scope.row.modelStatus === 1"
              ></i>
              <span v-if="scope.row.modelStatus === 1">已发布</span>
              <i
                class="little-circle-red"
                v-if="scope.row.modelStatus === 2"
              ></i>
              <span v-if="scope.row.modelStatus === 2">已停用</span>
            </template>
          </el-table-column>

          <el-table-column label="操作" align="center" width="350">
            <template slot-scope="scope">
              <el-link
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="goManagement(scope.row)"
                >管理</el-link
              >
              <el-link
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="goRelations(scope.row)"
                >模型关系</el-link
              >
              <el-link
                v-if="scope.row.modelStatus === 0"
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="handlePublish(scope.row, 1, '发布')"
                >发布</el-link
              >
              <el-link
                v-if="scope.row.modelStatus === 1"
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="handlePublish(scope.row, 2, '停用')"
                >停用</el-link
              >
              <el-link
                v-if="scope.row.modelStatus === 2"
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="handlePublish(scope.row, 1, '启用')"
                >启用</el-link
              >
              <el-link
                v-if="scope.row.modelStatus === 0"
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="handleDelete(scope.row)"
                >删除</el-link
              >
              <el-link
                :underline="false"
                type="primary"
                class="ontology-edit"
                @click.native.prevent="openRelatePhysicList(scope.row)"
                >关联物理模型</el-link
              >
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          class="km-pagination"
          background
          :small="true"
          layout="total, prev, pager, next,sizes, jumper"
          :total="total"
          :hide-on-single-page="!total"
          :page-size.sync="modelData.pageSize"
          :pager-count="7"
          :page-sizes="[10, 20, 30]"
          :current-page="modelData.pageNum"
          @current-change="handleCurrentChange"
          @size-change="handleSizeChange"
        >
        </el-pagination>
        <el-dialog
          :title="dialogConfig[dialogType].title"
          :visible.sync="dialogFormVisible"
          @close="afterDialogClose"
        >
          <el-form
            :model="modelParams"
            :rules="rules"
            ref="dialogForm"
            label-position="right"
            label-width="120px"
          >
            <el-form-item
              label="模型编码:"
              prop="modelCode"
              class="dialog-inline"
            >
              <el-input
                v-model.trim="modelParams.modelCode"
                maxlength="50"
                show-word-limit
              ></el-input>
            </el-form-item>
            <el-form-item
              label="模型名称:"
              prop="modelName"
              class="dialog-inline"
            >
              <el-input
                v-model.trim="modelParams.modelName"
                maxlength="50"
                show-word-limit
              >
              </el-input>
            </el-form-item>
            <el-form-item
              label="模型说明:"
              prop="description"
              class="dialog-inline"
            >
              <el-input
                type="textarea"
                :rows="5"
                maxlength="500"
                show-word-limit
                resize="none"
                v-model.trim="modelParams.description"
                :autosize="textSizeConfig"
                placeholder="请输入内容，限制500个字符"
              >
              </el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="resetDialogForm">取 消</el-button>
            <el-button
              type="primary"
              @click="submitDialogForm('dialogForm', 'createLogicModel')"
              :loading="loading"
              >确 定</el-button
            >
          </div>
        </el-dialog>
        <el-dialog
          title="关联物理模型"
          :visible.sync="beLinkedPhysicalVisible"
          v-if="beLinkedPhysicalVisible"
          width="70%"
        >
          <RelationalPhysicalModel
            :logicalModelId="logicalModelId"
          ></RelationalPhysicalModel>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="resetDialogForm">关 闭</el-button>
          </div>
        </el-dialog>
        <el-dialog
          title="创建物理模型"
          width="30%"
          :visible.sync="importFormVisible"
        >
          <el-form
            :model="createModelParams"
            :rules="rules"
            ref="createPhysicalForm"
            label-position="right"
            label-width="120px"
          >
            <el-form-item
              label="逻辑模型:"
              prop="logicalModelName"
              class="dialog-inline"
            >
              <el-input
                :disabled="true"
                v-model.trim="createModelParams.logicalModelName"
              ></el-input>
            </el-form-item>
            <el-form-item
              label="模型编码:"
              prop="modelCode"
              class="dialog-inline"
            >
              <el-input v-model.trim="createModelParams.modelCode"></el-input>
            </el-form-item>
            <el-form-item
              label="模型名称:"
              prop="modelName"
              class="dialog-inline"
            >
              <el-input v-model.trim="createModelParams.modelName"></el-input>
            </el-form-item>
            <el-form-item
              label="目标数据库:"
              prop="dataSourceId"
              class="dialog-inline"
            >
              <el-select
                width="100%"
                v-model="createModelParams.dataSourceId"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in baseDataList"
                  :key="item.key"
                  :label="item.value"
                  :value="item.key"
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              label="目标数据表:"
              prop="tableName"
              class="dialog-inline"
            >
              <el-input v-model.trim="createModelParams.tableName"></el-input>
            </el-form-item>
            <el-form-item
              label="模型说明:"
              prop="description"
              class="dialog-inline"
            >
              <el-input
                type="textarea"
                v-model.trim="createModelParams.description"
                :autosize="textSizeConfig"
              >
              </el-input>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="resetDialogForm">取 消</el-button>
            <el-button
              type="primary"
              @click="
                submitDialogForm('createPhysicalForm', 'createPhysicalModel')
              "
              :loading="loading"
              >确 定</el-button
            >
          </span>
        </el-dialog>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
import RelationalPhysicalModel from "./relationalPhysicalModel";
export default {
  name: "logicModelIndex",
  components: { RelationalPhysicalModel },
  data: () => {
    //属性英文校验
    var isEnglish = (rule, value, cb) => {
      const rex = /^[a-zA-Z][a-zA-Z0-9_]+$/;
      if (!rex.test(value)) {
        cb(
          new Error("字段格式必须是以字母开头,至少两个字符，且只能写_特殊字符")
        );
      }
      cb();
    };
    return {
      modelId: "", // 属性 id
      isShowTree: false, //是否显示树
      selectedNodeID: -1, //树选中节点id
      modelData: {
        modelName: "", //查询--模型名称
        modelStatus: "", //查询--状态
        pageNum: 1, // 页码
        pageSize: 10, // 每页条数
      },
      modelList: [], // 逻辑模型列表
      subjectList: [], //主题树列表
      filterText: "", //树查询关键字
      defaultProps: {
        //树-展示属性设置
        children: "children",
        label: "label",
      },
      addAble: false, //逻辑模型是否可创建
      dialogFormVisible: false, //创建、编辑弹窗默认状态
      modelParams: {
        //新建模型模板
        modelCode: "", // 模型编码
        modelName: "", // 模型名称
        description: "", // 模型说明
      },
      createModelParams: {
        //创建物理模型模板
        modelCode: "", // 模型编码
        modelName: "", // 模型名称
        description: "", // 模型说明
        dataSourceId: "", //目标数据库
        tableName: "", //目标数据表
        createStyle: 1, //创建方式
        logicalId: null, //逻辑模型id
        logicalModelName: "", //逻辑模型名称
      },
      multipleSelection: [], //列表选中的元素
      importFormVisible: false, //创建物理模型弹窗--默认关闭
      baseDataList: [], //数据库列表
      dialogType: "ADD", //默认弹窗类型--创建模型（edit,编辑模型）
      dialogConfig: {
        //不同类型弹窗标题及方法
        ADD: {
          title: "创建逻辑模型",
          funcName: "createModel",
        },
        EDIT: {
          title: "编辑逻辑模型",
          funcName: "editModel",
        },
      },
      rules: {
        //弹窗表单项规则
        modelCode: [
          {
            required: true,
            message: "请输入模型编码",
            trigger: "blur",
          },
          { validator: isEnglish, trigger: "change" },
        ],
        modelName: [
          {
            required: true,
            message: "请输入模型名称",
            trigger: "blur",
          },
        ],
        description: [
          {
            required: false,
            message: "请输入模型描述",
            trigger: "blur",
          },
        ],
        dataSourceId: [
          {
            required: true,
            message: "请选择目标数据库",
            trigger: "blur",
          },
        ],
        tableName: [
          {
            required: true,
            message: "请输入目标数据库表名称",
            trigger: "blur",
          },
          { validator: isEnglish, trigger: "change" },
        ],
      },
      textSizeConfig: {
        //texterea设置4-10行
        minRows: 4,
        maxRows: 10,
      },
      loading: false,
      total: 0, // 数据总条数
      beLinkedPhysicalVisible: false, //关联物理模型弹窗
      logicalModelId: null, //选中的模型id
    };
  },
  computed: {
    ...mapState({
      selectedList: (state) => state.modelDesign.selectedList,
      selectedID: (state) => state.modelDesign.selectedNodeID,
      selectedNode: (state) => state.modelDesign.selectedNode,
      selectedData: (state) => state.modelDesign.selectData,
    }),
  },
  created() {
    this.getSubjectList();
    this.getBaseDataList();
  },
  watch: {
    filterText(val) {
      //树结构查询关键字
      this.$refs.tree.filter(val);
    },
  },
  methods: {
    // 获取数据类型列表
    getBaseDataList() {
      let params = { source: 3, code: "baseName" };
      console.log("params", params);
      this.$axios
        .post(this.$api.modelDesign.physicModel.getBaseDataList, params)
        .then((res) => {
          console.log(res.data);
          let data = res.data.data;
          this.baseDataList = data;
        })
        .catch((err) => {
          console.error(err);
          this.$message.error(err.data.message);
        });
    },
    //创建模型--选择方式回调
    handleCommand(command) {
      this.$message("click on item " + command);
    },
    //树结构，筛选方法
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    //点击树节点-回调
    handleNodeClick(data) {
      console.log(data);
      this.selectedNodeID = data.id;
      this.$store.commit("modelDesign/save_selectedNode", data); //传递选中节点
      this.$store.commit(
        "modelDesign/save_selectedNodeID",
        this.selectedNodeID
      ); //传递选中节点id
      if (!data.children || data.children.length === 0) {
        this.addAble = true; //底层节点，可创建新模型
        this.getModelList(data.id);
      } else {
        this.addAble = false;
        this.getModelList(data.id);
      }
    },
    // 查询
    onSubmit(pageNum) {
      this.modelData.pageNum = pageNum ? pageNum : this.modelData.pageNum;
      this.getModelList(this.selectedNodeID);
    },
    // 展示树
    showTree(ID) {
      console.log(ID);
      this.isShowTree = true;
      this.selectedNodeID = ID;
      this.getModelList(ID);
      this.selectedID != -1
        ? this.handleNodeClick(this.selectedNode)
        : this.handleNodeClick(this.subjectList[0]);
      this.$nextTick(() => {
        this.$refs.tree.setCurrentKey(this.selectedNodeID); //一定要加这个选中了否则样式没有出来
      });
    },
    // 获取主题列表
    getSubjectList() {
      this.$axios
        .post(this.$api.modelDesign.logicModel.getSubjectList, {})
        .then((res) => {
          console.log(res);
          let data = res.data.data;
          this.subjectList = data;
          if (data.length > 0) {
            this.selectedID != -1
              ? this.showTree(this.selectedID)
              : this.showTree(data[0].id);
          }
          if (!data[0].children || data[0].children.length === 0)
            this.addAble = true;
        })
        .catch((err) => {
          console.error(err);
          this.$message.error(error.data.message);
        });
    },
    // 获取模型列表
    getModelList(ID) {
      let themeId = { themeId: ID };
      let params = { ...this.modelData, ...themeId };
      this.$axios
        .post(this.$api.modelDesign.logicModel.getModelList, params)
        .then((res) => {
          let data = res.data.data.list;
          this.modelList = data;
          this.total = res.data.data.totalCount;
        })
        .catch((err) => {
          console.error(err);
          this.$message.error(error.data.message);
        });
      console.log("this.modelData", this.modelData);
    },
    // 创建模型
    createLogicModel() {
      let themeId = { themeId: this.selectedNodeID };
      let params = { ...this.modelParams, ...themeId };
      console.log("add", params);
      this.loading = true;
      this.$axios
        .post(this.$api.modelDesign.logicModel.createLogicModel, params)
        .then((res) => {
          console.log(res);
          this.loading = false;
          this.$message({ message: "创建成功!", type: "success" });
          this.$nextTick(() => {
            this.getModelList(this.selectedNodeID);
          });
        })
        .catch((error) => {
          this.loading = false;
          this.$message.error(error.data.message);
        });
    },
    //发布，废止模型
    handlePublish(row, modelStatus, statusName) {
      this.$confirm(`是否确认${statusName}该版本模型？`)
        .then(() => {
          let params = {
            logicalModelId: row.logicalModelId,
            modelStatus: modelStatus,
          };
          console.log("发布", params);
          this.loading = true;
          this.$axios
            .post(this.$api.modelDesign.logicModel.publishModel, params)
            .then((res) => {
              this.loading = false;
              this.getModelList(this.selectedNodeID);
              this.$message({ message: res.data.message, type: "success" });
            })
            .catch((error) => {
              this.loading = false;
              this.$message.error(error.data.message);
            });
        })
        .catch(() => {});
    },
    //删除模型--当前版本
    handleDelete(row) {
      this.$confirm("是否确认删除该模型该版本？ 删除后将无法恢复，请谨慎操作 !")
        .then(() => {
          let params = { id: row.logicalModelId };
          console.log("删除", params);
          this.loading = true;
          this.$axios
            .post(
              `${this.$api.modelDesign.logicModel.deleteModelVersion}?logicalModelId=${row.logicalModelId}`
            )
            .then((res) => {
              this.loading = false;
              this.getModelList(this.selectedNodeID);
              this.$message({ message: "删除成功!", type: "success" });
            })
            .catch((error) => {
              this.loading = false;
              this.$message.error(error.data.message);
            });
        })
        .catch(() => {});
    },
    // 创建物理模型
    createPhysicalModel() {
      let themeId = { themeId: this.selectedNodeID };
      let params = { ...this.createModelParams, ...themeId };
      this.loading = true;
      this.$axios
        .post(this.$api.modelDesign.physicModel.createPhysicModel, params)
        .then((res) => {
          this.loading = false;
          if (res.data.message === "操作成功")
            this.$message({ message: "创建成功!", type: "success" });
          if (res.data.message != "操作成功")
            this.$message({ message: res.data.message, type: "error" });
          this.$nextTick(() => {
            this.getModelList(this.selectedNodeID);
          });
          this.importFormVisible = false;
          this.importStep = 1;
        })
        .catch((error) => {
          this.loading = false;
          this.$message.error(error.data.message);
        });
    },
    //列表选中触发
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 修改当前页码
    handleCurrentChange(page) {
      this.modelData.pageNum = page;
      this.getTableList();
    },
    //修改当前页面容量
    handleSizeChange(page) {
      this.modelData.pageSize = page;
      this.getTableList();
    },
    // 打开关联物理模型
    openRelatePhysicList(item) {
      this.logicalModelId = item.logicalModelId;
      this.$nextTick(() => {
        this.beLinkedPhysicalVisible = true;
      });
    },
    // 打开新增模型模态框
    openCreateOntology() {
      this.dialogType = "ADD";
      this.dialogFormVisible = true;
    },
    // 打开创建物理模型
    openCreatePhysicalModel(item) {
      this.logicalModelId = item.logicalModelId;
      if (this.multipleSelection.length > 1) {
        this.$message({
          message: "单次仅支持将单个逻辑模型生成物理模型！",
          type: "error",
        });
      } else if (this.multipleSelection.length === 0) {
        this.$message({
          message: "请选择逻辑模型！",
          type: "error",
        });
      } else {
        let data = this.multipleSelection[0];
        (this.createModelParams = {
          //创建物理模型模板
          modelCode: data.modelCode, // 模型编码
          modelName: "", // 模型名称
          description: data.description, // 模型说明
          dataSourceId: "", //目标数据库
          tableName: "", //目标数据表
          createStyle: 1, //创建方式
          logicalId: data.logicalModelId, //逻辑模型id
          logicalModelName: data.modelName, //逻辑模型名称
        }),
          this.$nextTick(() => {
            this.importFormVisible = true;
          });
      }
    },
    // 确定
    submitDialogForm(fromName, fnName) {
      this.$refs[fromName].validate((valid) => {
        if (valid) {
          this[fnName]();
          this.dialogFormVisible = false;
        } else {
          return false;
        }
      });
    },
    // 取消
    resetDialogForm() {
      this.dialogFormVisible = false;
      this.beLinkedPhysicalVisible = false;
      this.importFormVisible = false;
    },
    // 模态框关闭后
    afterDialogClose() {
      this.$refs.dialogForm && this.$refs.dialogForm.resetFields();
      this.$refs.createPhysicalForm &&
        this.$refs.createPhysicalForm.resetFields();
    },
    //管理---跳转到模型管理页面
    goManagement(item) {
      this.$store.commit("modelDesign/save_selectData", item); //传递选中元素
      this.$router.push(
        `/dataReceive/modelDesign/logicModelManagement/property/${item.logicalModelId}/`
      );
    },
    //模型关系---跳转到模型关系页面
    goRelations(item) {
      this.$store.commit("modelDesign/save_selectData", item); //传递选中元素
      this.$router.push(
        `/dataReceive/modelDesign/logicModelManagement/relationship/${item.logicalModelId}/`
      );
    },
  },
};
</script>
<style>
.dialog-warpper {
  padding: 20px;
}
</style>
<style lang="scss" scoped>
.content-warpper {
  display: flex;
  width: 100%;
  height: 92%;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}
.left-tree {
  width: 15%;
  height: 95%;
  background: #ffffff;
  overflow: auto;
  padding: 16px;
  border-right: 1px solid #dcdce6;
  border-radius: 4px 0;
  /deep/.el-input__inner {
    height: 32px;
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #e0e0e0;
  }
  .el-tree {
    padding-top: 16px;
    /deep/.el-tree-node {
      color: #333333;
      .el-tree-node__content {
        height: 30px;
      }
    }
    ::v-deep.el-tree-node.is-current > .el-tree-node__content {
      background-color: rgba(75, 113, 235, 0.16);
      border-left: 2px solid #4b71eb;
      color: #4b71eb;
    }
  }
}
.right-content {
  width: 85%;
}
.el-dialog-div {
  height: 60vh;
  overflow: hidden;
  // padding: 20px;
}
.server-main {
  position: relative;
  /deep/.el-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    height: 100%;
    justify-content: center;
  }
  .search-form {
    background: #ffffff;
    padding: 16px 32px;
    border-top-right-radius: 4px;
    .el-form-item {
      margin-bottom: 0;
    }
    .form-input {
      margin-right: 32px;
      .el-input,
      .el-select {
        ::v-deep .el-input__inner {
          width: 240px;
          height: 32px;
          background: #ffffff;
          border-radius: 2px;
          border: 1px solid #e0e0e0;
        }
      }
    }
  }

  .server-table {
    margin-top: 0;
    padding: 16px 32px 64px;
    background: #ffffff;
    border-top: 1px solid #dcdce6;
    .little-circle-green {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 3px;
      background: #55c898;
      position: relative;
      right: 4px;
      top: -2px;
    }

    .little-circle-red {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 3px;
      background: #ee5564;
      position: relative;
      right: 6px;
      top: -2px;
    }

    .little-circle-yellow {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 3px;
      background: #dba839;
      position: relative;
      right: 6px;
      top: -2px;
    }
    .table-title {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .table-title-text {
        margin: 8px 0;
        font-size: 16px;
        line-height: 16px;
        border-left: 5px solid $--color-primary;
        padding-left: 10px;
      }

      margin-bottom: 10px;
    }
  }
  .el-form-item {
    /deep/.el-select {
      width: 100%;
    }
  }

  .ontology-edit {
    padding: 0 10px;

    & + .ontology-edit {
      border-left: 1px solid #dddddd;
    }
  }

  ::v-deep .el-table__append-wrapper {
    padding: 10px;
  }

  ::v-deep .el-dialog {
    width: 500px;
    border-radius: 5px;
  }

  .dialog-inline {
    ::v-deep .el-form-item__content {
      width: calc(100% - 155px);
    }
    ::v-deep .el-textarea__inner {
      font-family: inherit;
    }

    button.el-button {
      background-color: $--color-primary !important;
      color: #fff !important;
      line-height: 1.2;
    }
  }
  ::v-deep .el-form-item__error {
    z-index: 10000;
    width: 115%;
  }
}
</style>
